#!/usr/bin/env python
# encoding=utf-8
#codeby     道长且阻
#email      ydhcui@suliu.net/QQ664284092
#website    http://www.suliu.net


import os
#数据库配置
DATABASE = {
    'datatype':'sqlite',#mysql
    'datahost':'127.0.0.1',
    'dataport':'3306',
    'dataname':'./data/USERDATA.db',
    'username':'',
    'password':'',
    'charset' :'utf8mb4'
}
#缓存配置
CACHE = {
    'type'    :'redis',#memcache
    'host'    :'localhost',
    'port'    :6379,
    'username':None,
    'password':None,
}

#celery任务队列配置
TASK = {
    'broker'  :'%s://%s@%s:%s/0'%(CACHE['type'],CACHE['password'],CACHE['host'],CACHE['port']),
    'backend' :CACHE['type']+'://',
    #'backend':'%s://%s@%s:%s/1'%(CACHE['type'],CACHE['password'],CACHE['host'],CACHE['port']),
}
#session配置
SESSION = {
    'host'    :CACHE['host'],
    'port'    :CACHE['port'],
    'password':CACHE['password'],
    'db'      :0,
    'charset' :'utf8'
}
#web网站配置
SETTINGS = {
    "debug"         : True,
    'gzip'          : False,
    'autoescape'    : False,
    #"xsrf_cookies"  : True,
    "login_url"     : "/#/user.login",
    "cookie_secret" : "e1tuaV1UW3NpXU9bMDFdUFtnZV1TW2RhXUVbc2FdQ1tiaV19",
    "template_path" : os.path.join(os.path.dirname(__file__), 'templates'),
    "static_path"   : os.path.join(os.path.dirname(__file__), "static"),
}
